cae1e96e6c49c9c74f376042d68d6a1c8c7baca2,zul/src/org/zkoss/zul/Tabs.java,Tabs,insertBefore,#Component#Component#,49

Before Change


		//you have to set the parent first, and then call setSelected!
		final boolean empty = getChildren().isEmpty();
		final Tab newtab = (Tab)child;
		if (!empty && newtab.isSelected()) newtab.setSelectedDirectly(false);

		if (super.insertBefore(child, insertBefore)) {
			final Tabbox tabbox = getTabbox();

After Change


		boolean sel = getChildren().isEmpty(), desel = false;
		final Tab newtab = (Tab)child;
		if (!sel && newtab.isSelected()) {
			newtab.setSelectedDirectly(false);	//turn off first
			sel = desel = true;					//trun on later
		}